package vip.idiy.anwei_android_iot.domin;

import android.util.Log;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * ClassName DeviceData
 * describe: 设备
 * Created: 勇
 * Email:118085890@qq.com
 * Version: 1.0
 * Create in 21:32 2023/4/21
 */
public class DeviceData {
    private final String TAG = "myTag " + " DeviceData ";
    private int id;
    private String deviceId;
    private String wifiName;
    private String wifiPsw;
    private boolean autoWiFi;
    private String mqttServer;
    private int mqttPort;
    private String mqttName;
    private String mqttPsw;
    private String mqttSub;
    private String mqttPub;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    public String getWifiName() {
        return wifiName;
    }

    public void setWifiName(String wifiName) {
        this.wifiName = wifiName;
    }

    public String getWifiPsw() {
        return wifiPsw;
    }

    public void setWifiPsw(String wifiPsw) {
        this.wifiPsw = wifiPsw;
    }

    public boolean isAutoWiFi() {
        return autoWiFi;
    }

    public void setAutoWiFi(boolean autoWiFi) {
        this.autoWiFi = autoWiFi;
    }

    public String getMqttServer() {
        return mqttServer;
    }

    public void setMqttServer(String mqttServer) {
        this.mqttServer = mqttServer;
    }

    public int getMqttPort() {
        return mqttPort;
    }

    public void setMqttPort(int mqttPort) {
        this.mqttPort = mqttPort;
    }

    public String getMqttName() {
        return mqttName;
    }

    public void setMqttName(String mqttName) {
        this.mqttName = mqttName;
    }

    public String getMqttPsw() {
        return mqttPsw;
    }

    public void setMqttPsw(String mqttPsw) {
        this.mqttPsw = mqttPsw;
    }

    public String getMqttSub() {
        return mqttSub;
    }

    public void setMqttSub(String mqttSub) {
        this.mqttSub = mqttSub;
    }

    public String getMqttPub() {
        return mqttPub;
    }

    public void setMqttPub(String mqttPub) {
        this.mqttPub = mqttPub;
    }

    // @Override
    // public String toString() {
    //     return new ToStringBuilder(this)
    //             .append("id", id)
    //             .append("deviceId", deviceId)
    //             .append("wifiName", wifiName)
    //             .append("wifiPsw", wifiPsw)
    //             .append("autoWiFi", autoWiFi)
    //             .append("mqttServer", mqttServer)
    //             .append("mqttPort", mqttPort)
    //             .append("mqttName", mqttName)
    //             .append("mqttPsw", mqttPsw)
    //             .append("mqttSub", mqttSub)
    //             .append("mqttPub", mqttPub)
    //             .toString();
    // }




    public boolean checkEmpty() {
        if (deviceId == null || deviceId.isEmpty()) {
            return false;
        }
        if (wifiName == null || wifiName.isEmpty()) {
            return false;
        }
        if (wifiPsw == null || wifiPsw.isEmpty()) {
            return false;
        }
        if (mqttServer == null || mqttServer.isEmpty()) {
            return false;
        }
        if (mqttPort == 0) {
            return false;
        }
        if (mqttName == null || mqttName.isEmpty()) {
            return false;
        }
        if (mqttPsw == null || mqttPsw.isEmpty()) {
            return false;
        }
        if (mqttSub == null || mqttSub.isEmpty()) {
            return false;
        }
        if (mqttPub == null || mqttPub.isEmpty()) {
            return false;
        }
        return true;
    }
}
